package com.zr.service;

import java.util.ArrayList;
import java.util.List;

import com.zr.dao.StudentDao;
import com.zr.model.Student;

import net.sf.json.JSONObject;

public class StuentService {
	StudentDao sd=new StudentDao();
	public JSONObject findAllStu(int start,int rows,int teacherId) {
		JSONObject jObj=new JSONObject();
		jObj.put("total", sd.findAllStuCount(teacherId));
		jObj.put("rows", sd.findAllStu(start,rows,teacherId));
		return jObj;
	}
	public JSONObject selectCname(int start,int rows,int teacherId,String cname) {
		JSONObject jObj=new JSONObject();
		jObj.put("total", sd.selectCnameCount(teacherId, cname));
		jObj.put("rows", sd.selectCname(start, rows, teacherId, cname));
		return jObj;
	}
}
